

import * as path from 'path';
import * as fsextra from 'fs-extra';
import { app } from 'electron';

export interface IPackageConfiguration {
	name: string;
	version: string;
}

const rootPath: string = app ? app.getAppPath() : (process.type == "renderer" ? require("@electron/remote").app.getAppPath() : process.cwd());
const packageJsonPath = path.join(rootPath, 'package.json');
console.log(packageJsonPath);
const configuration = fsextra.readJsonSync(packageJsonPath) as IPackageConfiguration;

export default configuration;